# coding:utf-8
from odoo import models, fields, api, _
from odoo.exceptions import Warning
import odoo.addons.decimal_precision as dp
from odoo.exceptions import UserError


class HrDepartment(models.Model):
    _inherit = 'hr.department'

    @ api.multi
    def write(self, vals):
        res = super(HrDepartment, self).write(vals)
        for dept in self:
            dept.member_ids.write({'department_id': dept.id})
        return res
